package com.wq.gof.designer.chain.list;

import java.util.List;

/**
 * @Author: wangqiang20995
 * @Date:2019/1/25
 * @Description:
 * @Resource:
 */
public class ListEventHandler extends AbstractChainEventHandler {

    public ListEventHandler(HandlerContext handlerContext){
        super(handlerContext);
    }

    @Override
    public void doHandle(Object conditions, HandlerContext handlerContext) {
        if(!(conditions instanceof List)){
            handlerContext.doHandler(conditions);
            return;
        }

        System.out.println("List handler处理请求");
        List list = (List) conditions;
        for(Object object : list){
            System.out.println("List Item --> " + object.getClass().getName());
        }
        handlerContext.resume();
        return;
    }
}
